#include<iostream>
#include<string>
#include<numeric>
#include<vector>
int main(void){
 using std::string;
 using std::vector;
 const char *cp = "hello world!!!";
 string s1(cp);
 string s2(s1,6);
 //string s3(s1,16);//起始下标超过size，报下标异常out_of_range
 string s4(s1,6,100);
 std::cout<<s2<<std::endl;
 std::cout<<s4<<std::endl;

 vector<string> vs;
 for(size_t index = 0; index < 10;index++){
    vs.push_back(std::to_string(index));
 }
 for(auto &vsItem:vs){
   std::cout<<vsItem<<std::endl;
 }

 string vssum = std::accumulate(vs.cbegin(),vs.cend(),string(""));
 std::cout<<vssum<<std::endl;
 return 0;
}
